﻿using ContentAppBase.Model.Bing;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace ContentAppBase.Utils
{
    public class SectionItemTemplateSelector : DataTemplateSelector
    {
        public DataTemplate ImageResultTemplate { get; set; }
        public DataTemplate WebResultTemplate { get; set; }

        protected override DataTemplate SelectTemplateCore(object item, DependencyObject container)
        {
            if (item is ImageResult)
            {
                return ImageResultTemplate;
            }
            else if (item is WebResult)
            {
                return WebResultTemplate;
            }

            return base.SelectTemplateCore(item, container);
        }
    }
}
